
"""
    属于jinja2的模板函数
        格式: response = render_template("模板文件")

    在模板中获取视图函数的变量
        格式{{ 变量 }}
"""

from flask import Flask, render_template

app = Flask(__name__)


@app.route("/")
def hello():

    num = 10
    s = "zifuchuan"
    t = (1, 3)
    l = [10, 5]
    d = {
        "age": 19,
        "name": "test"
    }

    resp = render_template("hello.html", number=num, str=s, tuple=t, list=l, dict=d)
    return resp


if __name__ == '__main__':
    app.run()


